(function(_app) {
    'use strict';

    var controllers = _app.controllers;
    
    _app.adminApp.config(function($routeProvider,$locationProvider) {
       
        $routeProvider
                .when('/', {
                    templateUrl: base_url + 'administrator/views/home.index',
                    controller: 'homeController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                			 
                		}
                	}
                })
                .when('/leilao/add', {
                    templateUrl: base_url + 'administrator/views/leilao.frm_leilao',
                    controller: 'leilaoController.Settings',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao/settings/:id', {
                    templateUrl: base_url + 'administrator/views/leilao.frm_leilao',
                    controller: 'leilaoController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao/:id/lotes', {
                    templateUrl: base_url + 'administrator/views/lotes.index',
                    controller: 'lotesControllerList',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                //lotesClosed
                .when('/leilao/:id/lotesClosed', {
                    templateUrl: base_url + 'administrator/views/lotes.lotesClosed',
                    controller: 'lotesControllerListClosed',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao/:id/importLotes', {
                    templateUrl: base_url + 'administrator/views/leilao.import',
                    controller: 'leilaoImportLotesController',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })

                .when('/importSeller', {
                    templateUrl: base_url + 'administrator/views/comitentes.import',
                    controller: 'comintentesImportarController',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao/:id/lotes/settings/:lid', {
                    templateUrl: base_url + 'administrator/views/lotes.frm_lote',
                    controller: 'lotesController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao/:id/lotes/add', {
                    templateUrl: base_url + 'administrator/views/lotes.frm_lote',
                    controller: 'lotesController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leilao', {
                    templateUrl: base_url + 'administrator/views/leilao.index',
                    controller: 'leiloesController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                			 
                		}
                	}
                })
                .when('/users', {
                    templateUrl: base_url + 'administrator/views/user.index',
                    controller:'userController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/user/settings/:id', {
                    templateUrl: base_url + 'administrator/views/user.frm',
                    controller: 'userController.Settings',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/user/add', {
                    templateUrl: base_url + 'administrator/views/user.frm',
                    controller: 'userController.Settings',
                    resolve:{
                		delay:function(){
                			// shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/user/changeStatus/:id/:status/:group', {
                    template:'<div><div class="overlay" ng-show="hideform"></div><div class="loading-img" ng-show="hideform"></div> Realizando Operação ...</div>',
                    controller: 'userController.Change',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/groups', {
                    templateUrl: base_url + 'administrator/views/groups.index',
                    controller:'groupsController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/banners', {
                    templateUrl: base_url + 'administrator/views/banners.index',
                    controller:'bannersController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                
                .when('/banners/add', {
                    templateUrl: base_url + 'administrator/views/banners.frm',
                    controller:'bannersController.Settings',
                    resolve:{
                		delay:function(){
                		//shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/banners/settings/:id', {
                    templateUrl: base_url + 'administrator/views/banners.frm',
                    controller:'bannersController.Settings',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/banner/activation/:type/:id', {
                    template: '<div> ... </div>',
                    controller:'bannersController.Actvation',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/leiloeiros', {
                    templateUrl: base_url + 'administrator/views/leiloeiros.index',
                    controller:'leiloeiroController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leiloeiro/settings/:id', {
                    templateUrl: base_url + 'administrator/views/leiloeiros.settings',
                    controller: 'leiloeiroController.Settings',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/leiloeiro/add', {
                    templateUrl: base_url + 'administrator/views/leiloeiros.settings',
                    controller: 'leiloeiroController.Settings',
                    resolve:{
                		delay:function(){
                			// shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/seller', {
                    templateUrl: base_url + 'administrator/views/comitentes.index',
                    controller: 'comitenteController',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/seller/add', {
                    templateUrl: base_url + 'administrator/views/comitentes.frm_comitente',
                    controller: 'comitenteController',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/seller/settings/:id', {
                    templateUrl: base_url + 'administrator/views/comitentes.frm_comitente',
                    controller: 'comitenteController',
                    resolve:{
                		delay:function(){
                			 //shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/categories/', {
                    templateUrl: base_url + 'administrator/views/categorias.index',
                    controller: 'categoriasController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/categories/add', {
                    templateUrl: base_url + 'administrator/views/categorias.frm_categoria',
                    controller: 'categoriasController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/categories/settings/:id', {
                    templateUrl: base_url + 'administrator/views/categorias.frm_categoria',
                    controller: 'categoriasController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                 .when('/subcategories/', {
                    templateUrl: base_url + 'administrator/views/subcategorias.index',
                    controller: 'subCategoriasController.Index',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/subcategories/add', {
                    templateUrl: base_url + 'administrator/views/subcategorias.frm_subcategoria',
                    controller: 'subCategoriasController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/subcategories/settings/:id', {
                    templateUrl: base_url + 'administrator/views/subcategorias.frm_subcategoria',
                    controller: 'subCategoriasController.Settings',
                    resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/buyers',{
                	templateUrl:base_url + 'administrator/views/arrematantes.index',
                	controller: 'arrematantesController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/buyers/add',{
                	templateUrl:base_url + 'administrator/views/arrematantes.select_type',
                	controller: 'arrematantesController.Frm',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/buyers/add/J',{
                	templateUrl:base_url + 'administrator/views/arrematantes.frm_juridica',
                	controller: 'arrematantesController.juridica',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/buyers/add/F',{
                	templateUrl:base_url + 'administrator/views/arrematantes.frm_fisica',
                	controller: 'arrematantesController.fisica'
                })
                .when('/buyers/settings/:id',{
                	template:'<div><h3>Checando...<h3></div>',
                	controller: 'arrematantesController.CheckRedirect'
                })
                .when('/buyers/settings/:id/F',{
                	templateUrl:base_url + 'administrator/views/arrematantes.frm_fisica',
                	controller: 'arrematantesController.fisica',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/buyers/settings/:id/J',{
                	templateUrl:base_url + 'administrator/views/arrematantes.frm_juridica',
                	controller: 'arrematantesController.juridica',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/conditionOfSale',{
                	templateUrl:base_url + 'administrator/views/condicoes.index',
                	controller: 'condicoesController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/conditionOfSale/add',{
                	templateUrl:base_url + 'administrator/views/condicoes.frm',
                	controller: 'condicoesController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/conditionOfSale/settings/:id',{
                	templateUrl:base_url + 'administrator/views/condicoes.frm',
                	controller: 'condicoesController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                //billets / boletos bancarios
                .when('/billets',{
                	templateUrl:base_url + 'administrator/views/boletos.index',
                	controller: 'boletosController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/billets/add',{
                	templateUrl:base_url + 'administrator/views/boletos.frm_boleto',
                	controller: 'boletosController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                 .when('/billets/settings/:id',{
                	templateUrl:base_url + 'administrator/views/boletos.frm_boleto',
                	controller: 'boletosController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                //banks
                .when('/banks',{
                	templateUrl:base_url + 'administrator/views/bancos.index',
                	controller: 'bancosController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/banks/add',{
                	templateUrl:base_url + 'administrator/views/bancos.frm_banco',
                	controller: 'bancosController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/banks/settings/:id',{
                	templateUrl:base_url + 'administrator/views/bancos.frm_banco',
                	controller: 'bancosController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                //accounts_banks
                
                .when('/accounts',{
                	templateUrl:base_url + 'administrator/views/contas.index',
                	controller: 'contasController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/accounts/add',{
                	templateUrl:base_url + 'administrator/views/contas.frm_conta',
                	controller: 'contasController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/accounts/settings/:id',{
                	templateUrl:base_url + 'administrator/views/contas.frm_conta',
                	controller: 'contasController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                
                //taxas config
                //banks
                .when('/taxas',{
                	templateUrl:base_url + 'administrator/views/taxas.index',
                	controller: 'taxasController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/taxas/add',{
                	templateUrl:base_url + 'administrator/views/taxas.frm_taxas',
                	controller: 'taxasController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/taxas/settings/:id',{
                	templateUrl:base_url + 'administrator/views/taxas.frm_taxas',
                	controller: 'taxasController.Settings',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                .when('/accountability',{
                	templateUrl:base_url + 'administrator/views/prestacaoContas.index',
                	controller: 'prestacaoContasController.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                
                .when('/accountability/clousingAuctions',{
                	templateUrl:base_url + 'administrator/views/prestacaoContas.fechamentoLeilao',
                	controller: 'prestacaoContasController.FechamentoLeilao',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/accountability/clousingAuctions/preview/:id',{
                	templateUrl:base_url + 'administrator/views/prestacaoContas.previewFechamento',
                	controller: 'prestacaoContasController.Preview',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/accountability/reports',{
                	templateUrl:base_url + 'administrator/views/prestacaoContas.relatorios',
                	controller: 'prestacaoContasController.Relatorios',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                .when('/accountability/reports/print/:id',{
                	templateUrl:base_url + 'administrator/views/prestacaoContas.relatoriosPrint',
                	controller: 'prestacaoContasController.RelatoriosPrint',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                
                 .when('/newsletter/emails',{
                	templateUrl:base_url + 'administrator/views/newsletter.emails',
                	controller: 'newsLetterEmails.Index',
                	resolve:{
                		delay:function(){
                			 shortcut.remove("Ctrl+S");
                		}
                	}
                })
                
                
                
                
                .when('/not-found', {
            templateUrl: base_url + 'administrator/views/404'
        });
        //redirect
        $routeProvider.otherwise({redirectTo: '/not-found'});
    });


    
    
    

    

})(cocApp);




